<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <form action="/login">
        输入验证码<input type="text" name="num"><br>
        验证码 
        <img src="http://127.0.0.1:3000/checkcode" id="img"/>
        <span id="btn">刷新验证码</span>
        <button>提交</button>
    </form>
    
    <script>
        btn.onclick = function() {
            // 重新加载,为了防止不更新图片，让路径每次点击都变化，通过一个无关紧要的操作，显示路径是在变化
            img.src = 'http://127.0.0.1:3000/checkcode?time='+Date.now()
        }
    </script>
</body>
</html>